package com.brillilab.service.core.inventory;

import java.util.List;

import com.brillilab.common.entity.PageVo;
import com.brillilab.domain.enums.space.SpaceTypeEnum;
import com.brillilab.domain.po.experiments.ExperimentStepReagent;
import com.brillilab.domain.po.inventory.ReagentInventory;
import com.brillilab.domain.po.kit.KitSpec;
import com.brillilab.domain.vo.inventory.ReagentInventoryWithOwner;
import com.brillilab.domain.vo.inventory.SpaceInventoryPaged;
import com.brillilab.domain.vo.kit.DeviceUnlock;
import com.brillilab.domain.vo.user.UserInfoVo;

/**
 * @author wuzhiyu
 * @Title: IReagentInventoryService
 * @ProjectName brill_lab
 * @Description: TODO
 * @date 2018/11/1420:10
 */
public interface IReagentInventoryService {
    Integer InventoryCountInSpace(Long spaceId, SpaceTypeEnum spaceTypeEnum);

    List<ReagentInventory> getBoxInventoryList(Long boxId);

    ReagentInventory selectById(Long id);

    boolean updateById(ReagentInventory entity);

    boolean deleteById(Long id);

    boolean changMoveBoxInventory(ReagentInventory newInv);

    /**
     * 根据kitId获取库存列表
     *
     * @param kitId
     * @return
     */
    List<ReagentInventory> selectListByKitId(Long kitId);

    /**
     * @return java.util.List<com.brillilab.domain.po.inventory.ReagentInventory>
     * @Description: get inventory List by kitId
     * @Params: [kitId]
     * @author wuzhiyu
     * @date 2018/11/19 10:56
     */
    List<ReagentInventory> getInventoryList(Long kitId, Long labMemberId, Long groupId);

    /**
     * @return java.lang.Long
     * @Description: TODO
     * @Params: []
     * @author wuzhiyu
     * @date 2018/11/20 15:13
     */
    Long generateInventoryGroupId();

    /**
     * @return java.lang.Integer
     * @Description: TODO
     * @Params: [list]
     * @author wuzhiyu
     * @date 2018/11/20 15:43
     */
    Integer saveInventoryList(List<ReagentInventory> list);

    /**
     * @return java.lang.Integer
     * @Description: TODO
     * @Params: [newInventory]
     * @author wuzhiyu
     * @date 2018/11/21 9:34
     */
    Integer changBoxInventory(ReagentInventory newInventory);

    /**
     * @return java.util.List<com.brillilab.domain.po.inventory.ReagentInventory>
     * @Description: TODO
     * @Params: [kitBoxId]
     * @author wuzhiyu
     * @date 2018/11/22 16:17
     */
    List<ReagentInventory> listByKitBoxId(Long kitBoxId);

    /**
     * @return java.lang.Integer
     * @Description: TODO
     * @Params: [updateList]
     * @author wuzhiyu
     * @date 2018/11/22 16:23
     */

    Integer updateListInventoryPosition(List<ReagentInventory> updateList);

    /**
     * @return com.brillilab.common.entity.PageVo<com.brillilab.domain.po.inventory.ReagentInventory>
     * @Description: TODO
     * @Params: [search]
     * @author wuzhiyu
     * @date 2018/11/23 9:46
     */
    PageVo<ReagentInventoryWithOwner> getSpaceInventoryPaged(Long labId, SpaceInventoryPaged search);

    /**
     * @return java.lang.Integer
     * @Description: TODO
     * @Params: [list]
     * @author wuzhiyu
     * @date 2018/11/23 15:16
     */
    Integer updateInventoryListAmount(List<ReagentInventory> list);

    /**
     * @return java.util.List<com.brillilab.domain.po.inventory.ReagentInventory>
     * @Description: TODO
     * @Params: [specLIst]
     * @author wuzhiyu
     * @date 2018/11/26 10:40
     */
    List<ReagentInventory> getInventoryCountByKitSpec(List<KitSpec> specLIst);

    /**
     * @return java.lang.Integer
     * @Description: TODO
     * @Params: [specList]
     * @author wuzhiyu
     * @date 2018/11/26 10:35
     */
    Integer deleteInventoryByKitSpec(List<KitSpec> specList);

    /**
     * @return java.util.List<com.brillilab.domain.po.inventory.ReagentInventory>
     * @Description: TODO
     * @Params: [sampleGroupId, labMemberId]
     * @author wuzhiyu
     * @date 2018/11/28 14:00
     */
    List<ReagentInventory> getSampleGroupInventoryList(Long sampleGroupId, Long labMemberId);

    /**
     * @param deleteIds
     * @return Integer
     * @author wmh
     */
    Integer deleteBatch(List<Long> deleteIds);

    /**
     * 通过reagentIds(list)查找inventory
     * @param reagentIds
     * @return List<ReagentInventory>
     * @author wmh
     */
    List<ReagentInventory> selectByReagentIdList(List<Long> reagentIds,List<Long> groupIds);


    /**
     * @return boolean
     * @Description: TODO
     * @Params: [roomId, name]
     * @author wuzhiyu
     * @date 2019/1/10 15:46
     */
    boolean updateRoomName(Long roomId, String name);

    List<ReagentInventory> getInventoryListByKitBoxId(Long kitBoxId);

    List<ReagentInventory> selectList(List<Long> inventoryIds, Integer isDelete);

    Integer deleteByKitId(Long kitId);

    Integer getBoxGridInventoryCount(Long boxGridId);

    List<ReagentInventory> listByInventoryGroupId(Long posCombId);

    Long generateInventoryCombId();

    List<ReagentInventory> selectListByReagentId(Long reagentId);

    List<DeviceUnlock> selectKitUsageDeviceUnLockList(List<Long> inventoryIds);

    List<ReagentInventory> selectListByReagentIds(List<Long> ngReagentIds);

    List<ReagentInventory> selectByStepReagents(List<ExperimentStepReagent> stepReagents);
    
    
    boolean isUseInventory(UserInfoVo user, Long kitId);

    List<ReagentInventory> selectListByKitIdList(List<Long> kitIds,List<Long> groupIds);
}
